{{useCss "app-pages/css/cart.scss"}}
<div class="fcart">
    <div class="ftitle">购物车</div>
    {{#if user.cart_detail.length}}
    <div class="carts">
        <div>
            {{#each user.cart_detail}}
            <div>
                {{#each goods_info}}
                <div class="cart">
                    <div class="cart-item goods-img">
                        <href to="/goods_details/details.html?id={{goods_id}}">
                            <img bind-src="{{goods.preview_img_url}}">
                        </href>
                    </div>

                    <div class="cart-item detail">
                        <href to="/goods_details/details.html?id={{goods_id}}">
                            {{goods.goods_name}}
                            <p>{{goods.intro}}</p>
                        </href>
                    </div>

                    <div class="cart-item choice">
                        <div class="count">
                            <input event-change="{{'$Top.$Event.cart.update_cart_num'}}" min=1 max="{{max_num}}" value="{{num}}" bind-input="{{'num'}}" type="number" />
                        </div>
                    </div>

                    <div class="cart-item price">
                        单价：
                        <span class="price_num">￥{{goods.price}}</span>
                    </div>

                    <div class="cart-item method">
                        <div event-click="{{'$Top.$Event.cart.remove_goods'}}" class="remove">
                            <button>移除</button>
                        </div>
                    </div>
                </div>
                {{/each}}
            </div>
            {{/each}}
        </div>
    </div>

    <div class="allcount">
        <div class="box">
            <div class="price">商品原价总计:
                <red>￥</red>
                <span>{{#Fixed $Cache.cart.money_ach.sou_cash}}</span>
            </div>
            <div class="price">优惠:
                <red>￥</red>
                <span>{{#Fixed $Cache.cart.money_ach.sou_cash-$Cache.cart.money_ach.cash}}</span>
            </div>
            <div class="price">需付金额:
                <red>￥</red>
                <span>{{#Fixed $Cache.cart.money_ach.cash}}</span>
            </div>
            <div class="settlement">
                <button event-click="{{'$Event.cart.cart_to_ach'}}">确认订单</button>
            </div>
        </div>
    </div>

    {{#else}}
    <br/>
    <p>购物车中暂无商品</p>
    {{/if}}
</div>
